gir: fix another out parameter
authorFelix Krull <f_krull@gmx.de>
Tue, 25 Aug 2020 18:57:36 +0000 (20:57 +0200)
committerColin Walters <walters@verbum.org>
Fri, 6 May 2022 16:53:56 +0000 (12:53 -0400)
rust-bindings/rust/gir-files/OSTree-1.0.gir
rust-bindings/rust/src/auto/sign.rs
rust-bindings/rust/src/auto/versions.txt
rust-bindings/rust/sys/src/auto/versions.txt

index e457d52436b6d869f8c0097664ae2b0ab53379c7..2a84249ffadf40acf1a678082ef68d09413e1e60 100644 (file)
@@ -13925,7 +13925,10 @@ the secret key with #ostree_sign_set_sk.</doc>
                  line="273">the raw data to be signed with pre-loaded secret key</doc>
             <type name="GLib.Bytes" c:type="GBytes*"/>
           </parameter>
-          <parameter name="signature" transfer-ownership="none">
+          <parameter name="signature"
+                     direction="out"
+                     caller-allocates="0"
+                     transfer-ownership="full">
             <doc xml:space="preserve"
                  filename="ostree-sign.c"
                  line="274">in case of success will contain signature</doc>
@@ -14364,7 +14367,10 @@ the secret key with #ostree_sign_set_sk.</doc>
                  line="273">the raw data to be signed with pre-loaded secret key</doc>
             <type name="GLib.Bytes" c:type="GBytes*"/>
           </parameter>
-          <parameter name="signature" transfer-ownership="none">
+          <parameter name="signature"
+                     direction="out"
+                     caller-allocates="0"
+                     transfer-ownership="full">
             <doc xml:space="preserve"
                  filename="ostree-sign.c"
                  line="274">in case of success will contain signature</doc>
@@ -15013,7 +15019,10 @@ Based on ostree_repo_add_gpg_signature_summary implementation.</doc>
                    line="273">the raw data to be signed with pre-loaded secret key</doc>
               <type name="GLib.Bytes" c:type="GBytes*"/>
             </parameter>
-            <parameter name="signature" transfer-ownership="none">
+            <parameter name="signature"
+                       direction="out"
+                       caller-allocates="0"
+                       transfer-ownership="full">
               <doc xml:space="preserve"
                    filename="ostree-sign.c"
                    line="274">in case of success will contain signature</doc>
index 3583a61f4363933aef611b1c888fa83e0b50c9a4..2f71572010a0069ec755e662994c983b92685171 100644 (file)
@@ -59,7 +59,7 @@ pub trait SignExt: 'static {
     fn commit_verify<P: IsA<gio::Cancellable>>(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&P>) -> Result<Option<GString>, glib::Error>;
 
     #[cfg(any(feature = "v2020_2", feature = "dox"))]
-    fn data<P: IsA<gio::Cancellable>>(&self, data: &glib::Bytes, signature: &glib::Bytes, cancellable: Option<&P>) -> Result<(), glib::Error>;
+    fn data<P: IsA<gio::Cancellable>>(&self, data: &glib::Bytes, cancellable: Option<&P>) -> Result<glib::Bytes, glib::Error>;
 
     #[cfg(any(feature = "v2020_2", feature = "dox"))]
     fn data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant) -> Result<Option<GString>, glib::Error>;
@@ -125,11 +125,12 @@ impl<O: IsA<Sign>> SignExt for O {
     }
 
     #[cfg(any(feature = "v2020_2", feature = "dox"))]
-    fn data<P: IsA<gio::Cancellable>>(&self, data: &glib::Bytes, signature: &glib::Bytes, cancellable: Option<&P>) -> Result<(), glib::Error> {
+    fn data<P: IsA<gio::Cancellable>>(&self, data: &glib::Bytes, cancellable: Option<&P>) -> Result<glib::Bytes, glib::Error> {
         unsafe {
+            let mut signature = ptr::null_mut();
             let mut error = ptr::null_mut();
-            let _ = ostree_sys::ostree_sign_data(self.as_ref().to_glib_none().0, data.to_glib_none().0, signature.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
-            if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
+            let _ = ostree_sys::ostree_sign_data(self.as_ref().to_glib_none().0, data.to_glib_none().0, &mut signature, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
+            if error.is_null() { Ok(from_glib_full(signature)) } else { Err(from_glib_full(error)) }
         }
     }
 
index 52a580a67dc8fe3d2dfbe1d00c0704af0edfbb7e..79591983e94a26c45ee976cb88ae60f7b1317834 100644 (file)
@@ -1,2 +1,2 @@
 Generated by gir (https://github.com/gtk-rs/gir @ 2d1ffab1)
-from gir-files (https://github.com/gtk-rs/gir-files @ 8338f8c+)
+from gir-files (https://github.com/gtk-rs/gir-files @ ed7b959+)
index 52a580a67dc8fe3d2dfbe1d00c0704af0edfbb7e..79591983e94a26c45ee976cb88ae60f7b1317834 100644 (file)
@@ -1,2 +1,2 @@
 Generated by gir (https://github.com/gtk-rs/gir @ 2d1ffab1)
-from gir-files (https://github.com/gtk-rs/gir-files @ 8338f8c+)
+from gir-files (https://github.com/gtk-rs/gir-files @ ed7b959+)